<?php
namespace app\common\model;

class Tag extends Common {
    protected $append  = [
        'dealername',
    ];
    protected function getAlldataAttr($value, $data) {
        $data['dealername'] = model('AdminUser')->where('roleid', '6')->where('dealerid', $data['tagdealer'])->value('fullname');
        $data['statusname'] = $data['tagstatus'] == 1 ? '显示': '隐藏';
        return $data;
    }

    protected function getDealernameAttr($value, $data) {
        $data['dealername'] = model('AdminUser')->where('roleid', '6')->where('dealerid', $data['tagdealer'])->value('fullname');
        return $data['dealername'];
    }
    
}